//
//  ADJgSDKBannerCustomEvent.m
//  AnyThinkSDKDemo
//
//  Created by 刘娟 on 2024/9/24.
//  Copyright © 2024 抽筋的灯. All rights reserved.
//

#import "ADJgSDKBannerCustomEvent.h"


@implementation ADJgSDKBannerCustomEvent

-(void)loadBannerWithPosId:(NSString *)posId frame:(CGRect)frame{
    self->_bannerAdContainer = [[ADJgSDKBannerAdContainer alloc] initPosId:posId delegate:self frame:frame];
    [self->_bannerAdContainer loadAndShow];
}

- (void)adjg_bannerAdCloseLandingPage:(nonnull ADJgSDKBannerAdView *)bannerView {
    [_bannerAdContainer close];
    [self trackBannerAdClosed];
}

- (void)adjg_bannerViewClicked:(nonnull ADJgSDKBannerAdView *)bannerView { 
    [self trackBannerAdClick];
}

- (void)adjg_bannerViewClose:(nonnull ADJgSDKBannerAdView *)bannerView { 
    [self trackBannerAdClosed];
}

- (void)adjg_bannerViewDidPresent:(nonnull ADJgSDKBannerAdView *)bannerView { 
    
}

- (void)adjg_bannerViewDidReceived:(nonnull ADJgSDKBannerAdView *)bannerView { 
    [self trackBannerAdLoaded:bannerView adExtra:nil];
}

- (void)adjg_bannerViewExposure:(nonnull ADJgSDKBannerAdView *)bannerView { 
    [self trackBannerAdImpression];
}

- (void)adjg_bannerViewFailToReceived:(nonnull ADJgSDKBannerAdView *)bannerView errorModel:(nonnull ADJgAdapterErrorDefine *)errorModel { 
    NSError *error = nil;
    [self trackBannerAdLoadFailed:nil];
}

- (NSString *)networkUnitId {
    return self.serverInfo[@"slot_id"];
}
@end
